package com.csu.soa_library.controller;

import com.csu.soa_library.entity.Book;
import com.csu.soa_library.service.demoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.Optional;

/**
 * @author YiGongLily
 * @version V1.0
 * Copyright (c) 2024, bie blind copy all thing fine.
 * @ProjectName:soa_library
 * @Title: demoController
 * @Package com.csu.soa_library.controller
 * @Description: demo
 * @date 2024/11/25 21:24
 */

@RestController
public class demoController {
    @Autowired
    private demoService demoService;

    @GetMapping("/demo/{id}")
    public Book demo(@PathVariable Long id){
        return demoService.getBookById(id);
    }

}
